// Initialize your app
  var myApp = new Framework7();

  // Export selectors engine
  var $$ = Dom7;

  // Add view
  var mainView = myApp.addView('.view-main', {
      // Because we use fixed-through navbar we can enable dynamic navbar
      dynamicNavbar: true,
      domCache: true
  });

  // Initial load
  function stripMessage(messageText) {
      messageText = $.emoticons.replace(messageText);
      if (!(messageText.indexOf('<img') === 0 && messageText.split('<').length === 2 || messageText.indexOf('<span class="emoticon') >= 0)) {
          messageText = messageText.replace(/>/g, '&gt;').replace(/</g, '&lt;');
      }
      messageText.replace(/script/g, 'scr\bipt');
      return messageText;
  }
  // Format date
  function formatDay(d) {
      var date = new Date(d);
      var weekDay = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday'.split(' ')[date.getDay()];
      var day = date.getDate();
      var month = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ')[date.getMonth()];
      return weekDay + ', ' + month + ' ' + day;
  }
  function formatTime(d) {
      var date = new Date(d);
      var hours = date.getHours();
      if (hours < 10) hours = '0' + hours;
      var mins = date.getMinutes();
      if (mins < 10) mins = '0' + mins;
      return hours + ':' + mins;
  }
  function formatDate(d) {
      return formatDay(d) + ', <span>' + formatTime(d) + '</span>';
  }
  /*获取地址栏信息*/
  function getUrlParams(){
    var search = window.location.search ; 
    // 寫入數據字典
    var tmparray = search.substr(1,search.length).split("&");
    var paramsArray = new Array; 
    if( tmparray != null){
        for(var i = 0;i<tmparray.length;i++){
            var reg = /[=|^==]/;    // 用=進行拆分，但不包括==
            var set1 = tmparray[i].replace(reg,'&');
            var tmpStr2 = set1.split('&');
            var array = new Array ; 
            array[tmpStr2[0]] = tmpStr2[1] ; 
            paramsArray.push(array);
        }
    }
    // 將參數數組進行返回
    return paramsArray ;     
 }
  // 获取url参数值
  function getParamValue(name){
    var paramsArray = getUrlParams();
    if(paramsArray != null){
        for(var i = 0 ; i < paramsArray.length ; i ++ ){
            for(var  j in paramsArray[i] ){
                if( j == name ){
                    return paramsArray[i][j] ; 
                }
            }
        }
    }
    return '' ; 
 }